<!-- Content Header (Page header) -->
<section class="content-header">
    <h1>菜单/设备管理</h1>
    <ol class="breadcrumb">
        <li><a href="javascript:void(0);"><i class="fa fa-dashboard"></i>
            首页</a></li>
        <li><a href="#">系统管理</a></li>
        <li class="active">菜单/设备管理</li>
    </ol>
</section>


<!-- Main content -->
<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box box-primary">
                <div class="box-body">
                    <div class="row">
                        <div class="col-sm-3">
                            <div class="dataTables_length" style="display: inline-block;">
                                <label>
                                    <select class="form-control input-sm page" style="width:auto;">
                                        <option>10</option>
                                        <option>20</option>
                                        <option>30</option>
                                        <option>30</option>
                                        <option>40</option>
                                    </select>
                                    记录/页
                                </label>
                            </div>
                        </div>
                        <div class="col-sm-9">
                            <div class="dataTables_filter" id="searchDiv">
                                <input type="mac" placeholder="请输入mac" title="mac" name="mac" class="form-control">
                                <select  type="search"  title="设备状态" name="status" class="form-control status"></select>
                                <div class="btn-group" style="margin-bottom:2px;">
                                    <button type="button" class="btn btn-primary" data-btn-type="search">查询</button>
                                </div>
                            </div>
                        </div>
                    </div>


                    <table id="check_table" class="table table-bordered table-striped table-hover" style="margin-bottom:20px;">
                        <thead>
                        <tr>
                            <th name="id" style="text-align: center;">id</th>
                            <th name="mac" style='text-align: center;'>mac地址</th>
                            <th name="createDateTime" style='text-align: center;'>创建时间</th>
                            <th name="phone" style='text-align: center;'>绑定人手机号</th>
                            <th name="status" style='text-align: center;'>设备状态</th>
                            <th name="pushType" style='text-align: center;'>推送类别</th>
                            <th name="matchText" style='text-align: center;'>匹配文字</th>
                            <th name="startTime" style='text-align: center;'>工作时间始</th>
                            <th name="endTime" style='text-align: center;'>工作时间止</th>
                            <th name="" style='text-align: center;'>功能选项</th>
                        </tr>
                        </thead>
                        <tbody></tbody>
                    </table>
                    <div class="paging"></div>
                </div>
            </div>
        </div>
        </div>
    </div>
</section>

<script>

    $(function() {
        loadSelectByClassAsync("/device/status",null,"status","请选择设备状态","code","status");
        var table=initTable("/device/user/num","/device/user",
            $(".content #searchDiv"),
            $(".content table"),
            $(".content .page"),
            $(".content .paging"));
        var param={
            htmlUrl:"./device/deviceForm.html",
            getEntityUrl:"/device/user",
            updateEntityUrl:"/device/user",
            table:$("table"),
            editTitle:"修改设备工作模式",
            initFormDataBeforeCallback:function (data) {
                if(data.pushType==1)$("#deviceForm .matchText").hide();
                else $("#deviceForm .matchText").show();
            }
        };
        var winId=EditEntity(param,table.search);
    });

</script>
